<!DOCTYPE html>
<html>
<head>
<title>录入VIP客户</title>
</head>
<body>
	<header>
		<h1>查看/修改VIP客户信息</h1>
	</header>
	<main>
		 <p>
            <label>*手机号:<input v-model="e.mobile"  placeholder="将作为VIP编号"></label>
        </p>
        <p>
            <label>*会员等级:
            	<select id="rankSelect" v-model="e.rankId">
            	</select>
            </label>
        </p>
        <p>
            <label>*姓名:<input v-model="e.name" ></label>
        </p>
        <p>
            <label>*性别:</label>
            <label>
            <input  name="sex" type="radio" value="1" checked>男
            </label>
            <label>
            <input  name="sex" type="radio" value="0">女
            </label>
        </p>
        <p>
            <label>生日:<input type="date"  v-model="e.birthday"></label>
        </p>
        <p>
            <label>QQ:<input v-model="e.qq" ></label>
        </p>
        <p>
            <label>Email:<input  v-model="e.email"></label>
        </p>
        <p>
            <label>邮编:<input v-model="e.zipCode"></label>
        </p>
        <p>
            <label>邮寄地址:<input v-model="e.address" ></label>
        </p>
        <p>
            <label>备注:<textarea v-model="e.remark"></textarea></label>
        </p>
        <p>
            <button @click="modify">确定</button>
            <a href="/vip/list.html">返回</a>	
        </p>
	</main>
	
	<script src="/static/js/jquery.js"></script>
	 <script
		src="/static/js/yi.toast.js"></script> 
		<script src="/static/js/vue.js"></script>
		
		<script>
			const vue=new Vue({
				el:"main",
				data:{
					e:{
						//TODO 获取id
						id:"${param.id}"
					}
					
				},
				methods:{
					modify:function(){
						$.post("/vip/mod.do",this.e,function(resp){
							
							if(resp.code!=="ok"){
								toast(resp.message);
							}else{
								toast("修改成功，请返回!");
								//vue.e=resp.data;
							}
						});
					}
				},
				created:function(){
					$.getJSON("/vip/check.do",{
						id:this.e.id
					},function(resp){
						if(resp.code!=="ok"){
							toast(resp.message);
						}else{
							console.log(resp);
							vue.e=resp.data;
						}
					});
					
				}
			});
		
		</script>
</body>
</html>